package com.bjzsly.star3.xyh.auth.model;

import org.json.JSONObject;

/**
 * Created by ly on 2017/9/27.
 */

public class UserInfoQ {

    private String name = "null";

    private String gender = "";

    private String imgUrl = "";

    public static UserInfoQ createUserInfo(JSONObject json) {
        UserInfoQ userInfo = new UserInfoQ();
        try {
            if (json != null) {
                userInfo.setName(json.optString("nickname", "null"));
                userInfo.setGender(json.optString("gender", "null"));
                userInfo.setImgUrl(json.optString("figureurl_qq_2", ""));
            }
        } catch (Exception e) {
        }
        return userInfo;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    @Override
    public String toString() {
        return "UserInfoQ{" +
                "name='" + name + '\'' +
                ", gender='" + gender + '\'' +
                ", imgUrl='" + imgUrl + '\'' +
                '}';
    }
}
